package com.zhb.controller;

import com.zhb.beans.User;
import com.zhb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @program: upload_demo
 * @description:
 * @author: rainboz
 * @create: 2019-10-24 18:18
 **/
@Controller
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/user")
    public String getAllUser(Model model){
        List<User> users = userService.userList();
        model.addAttribute("list",users);
        System.out.println(users);
        return "list";
    }
}
